package cn.com.blueInfo.HaiYuan.business.drugs.controller;

import cn.com.blueInfo.HaiYuan.business.drugs.service.DrugsBaseService;
import cn.com.blueInfo.utils.result.BootstrapTable;
import cn.com.blueInfo.utils.result.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 药品基本信息管理
 * @ClassName: DrugsBaseController
 * @author suxch
 * @date 2019年4月24日  上午10:22:00
 */
@RestController
@RequestMapping("/operation/business/drugsBase")
public class DrugsBaseController {

    @Autowired
    private DrugsBaseService baseService;

    /**
     * 分页查询药品基本信息
     * @Title: queryDrugsBaseInfoByPage
     * @param request
     * @return BootstrapTable
     * @throws
     */
    @RequestMapping("/queryDrugsBaseInfoByPage.do")
    public BootstrapTable queryDrugsBaseInfoByPage(HttpServletRequest request) {
        return baseService.queryDrugsBaseDataByPage(request);
    }

    /**
     * 查询药品基本信息
     * @Title: queryDrugsBaseInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/queryDrugsBaseInfo.do")
    public ResultInfo queryDrugsBaseInfo(HttpServletRequest request) {
        return baseService.queryDrugsBaseData(request);
    }

    /**
     * 通过药品名称获取拼音缩写
     * @Title: getRenPingByDrugName
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/getRenPingByDrugName.do")
    public ResultInfo getRenPingByDrugName(HttpServletRequest request) {
        return baseService.queryRenPingByDrugName(request);
    }

    /**
     * 获取最大排序编号
     * @Title: getMaxOrderNumber
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/getMaxOrderNumber.do")
    public ResultInfo getMaxOrderNumber(HttpServletRequest request) {
        return baseService.queryMaxOrderNumber(request);
    }

    /**
     * 新增药品基本信息
     * @Title: addDrugsBaseInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/addDrugsBaseInfo.do")
    public ResultInfo addDrugsBaseInfo(HttpServletRequest request) {
        return baseService.addDrugsBaseData(request);
    }

    /**
     * 更新药品基本信息
     * @Title: updateDrugsBaseInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/updateDrugsBaseInfo.do")
    public ResultInfo updateDrugsBaseInfo(HttpServletRequest request) {
        return baseService.updateDrugsBaseData(request);
    }

    /**
     * 删除药品基本信息
     * @Title: deleteDrugsBaseInfo
     * @param request
     * @return ResultInfo
     * @throws
     */
    @RequestMapping("/deleteDrugsBaseInfo.do")
    public ResultInfo deleteDrugsBaseInfo(HttpServletRequest request) {
        return baseService.deleteDrugsBaseData(request);
    }

}
